/*!
 * @file person_server.cpp
 * @brief
 * @author FanKaiyu
 * @version 0.0.1
 * @date 2022-03-17
 */
#include <ros/ros.h>
#include "learning_service/Person.h"

bool personCallback(learning_service::Person::Request& req, learning_service::Person::Response& res)
{
  ROS_INFO("Person: name:%s  age:%d  sex:%d]", req.name.c_str(), req.age, req.sex);

  res.result = "OK";

  return true;
}

int main(int argc, char** argv)
{
  ros::init(argc, argv, "person_server");

  ros::NodeHandle n;

  ros::ServiceServer srv = n.advertiseService("/show_person", personCallback);

  ROS_INFO("Ready to show person information.");

  ros::spin();
  return 0;
}